@echo off
title ${artifactId}

set projectName=${artifactId}
set fileName=%projectName%-1.0.jar
set deployPath=Z:\

echo [42;97m清理文件...[m
echo.
del /Q/F %deployPath%%fileName%
rmdir /s/q %USERPROFILE%\.m2\repository\com\system\commons\system-lang
echo.
echo [42;97m文件清理完成！[m
echo.

echo [42;97m当前分支信息[m
echo.
git -C %~dp0 branch -a
echo.
echo [42;97m更新项目...[m
echo.
git -C %~dp0 fsck --lost-found
git -C %~dp0 gc --prune=now
git -C %~dp0 pull
echo.
echo [42;97m更新完成，开始编译项目！[m
echo.

call mvn -f %~dp0\pom.xml clean package -U

echo.
echo [42;97m正在拷贝(%fileName%)到发布目录(%deployPath%)...[m
echo.
echo 拷贝文件从%~dp0%projectName%-assemble\target\%fileName%到%deployPath%
copy %~dp0%projectName%-assemble\target\%fileName% %deployPath%
echo.
echo [42;97m拷贝完成！[m
echo.
echo =====================
echo 是否启动程序(Y/N)
echo =====================
set choice=
set /p choice=请选择:
if /i \"%choice%\"==\"Y\" java -jar %projectName%-assemble/target/%projectName%-1.0.jar